<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "iliketry.messages".
 *
 * @property integer $no
 * @property string $title
 * @property string $content
 * @property integer $post_member
 * @property integer $receive_member
 * @property string $add_time
 * @property integer $category
 * @property integer $del_flag
 */
class Messages extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'iliketry.messages';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'content', 'post_member', 'receive_member', 'add_time', 'category'], 'required'],
            [['content'], 'string'],
            [['post_member', 'receive_member', 'category', 'del_flag'], 'integer'],
            [['add_time'], 'safe'],
            [['title'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'no' => 'No',
            'title' => 'Title',
            'content' => 'Content',
            'post_member' => 'Post Member',
            'receive_member' => 'Receive Member',
            'add_time' => 'Add Time',
            'category' => '类别1会员消息2系统消息3快递消息4好友申请',
            'del_flag' => 'Del Flag',
        ];
    }

    /**
     * @inheritdoc
     * @return MessagesQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new MessagesQuery(get_called_class());
    }
}
